﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DropDownList1.Items.Add("新华社");
                DropDownList1.Items.Add("人民网");
                DropDownList1.Items.Add("央视网");
                Time.Text = DateTime.Now.ToLongDateString(); ;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string innerText = TextArea1.InnerText;
            if (string.IsNullOrEmpty(innerText))
            {
                Label4.Text = "请输入新闻的内容:";
            }
            else
            {
                Label4.Text = $"输入的新闻的来源为{DropDownList1.SelectedValue}";
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            TextArea1.InnerText = null;
        }
    }
}